package cn.com.code.design;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.math.BigDecimal;

/**
 * @author zhengpei
 * @date 2021/9/23
 */
public class PayController {

  private static final Logger logger = LoggerFactory.getLogger(PayController.class);

  public boolean doPay(String uId, String tradeId, BigDecimal amount, int channelType, int modeType) {
    // 微信支付
    if (1 == channelType) {
      logger.info("模拟微信渠道支持划账开始uId:[{}].tradeId:[{}],amount:[{}]", uId, tradeId, amount);
      if (1 == modeType) {
        logger.info("密码支付,风险校验环境安全");
      } else if (2 == modeType) {
        logger.info("人脸支付,风险校验脸部识别");
      } else if (3 == modeType) {
        logger.info("指纹支付,风险校验值指纹信息");
      }
    } else if (2 == channelType) {
      // 指纹支付
      logger.info("模拟支付宝渠道只服划账开始uId:[{}].tradeId:[{}],amount:[{}]", uId, tradeId, amount);
      if (1 == modeType) {
        logger.info("密码支付,风险校验环境安全");
      } else if (2 == modeType) {
        logger.info("人脸支付,风险校验脸部识别");
      } else if (3 == modeType) {
        logger.info("指纹支付,风险校验值指纹信息");
      }
    }
    return true;
  }

}
